<template>
	<view>
		<u-list @scrolltolower="scrolltolower">
			<u-list-item v-for="(item, index) in list" :key="index">
				<u-cell :border="false" :label="item.add_time.slice(0,16)">
					<view slot="title">
						<text class="youqu-color_">{{item.name}}</text>
						<text style="margin-left: 10rpx;">{{item.content}}</text>
						<text class="youqu-color_" v-if="item.event_tag">【{{item.event_tag}}】</text>
					</view>
					<u-avatar slot="icon" size="35" :src="item.headImg" customStyle="margin: 0 10px 0 0"></u-avatar>
				</u-cell>
				<view v-show="item.event_nid" class="detail" @click="gotoDetail(item.event_nid)">
					<view class="left">
						<u--image :showLoading="true" :src="item.event_img" width="150px" height="50px"></u--image>
					</view>
					<view class="right">
						<u--text :text="item.event_name" :lines="2"></u--text>
					</view>

				</view>
				<u-divider></u-divider>
			</u-list-item>
		</u-list>
	</view>
</template>

<script>
	import * as MemberApi from '@/api/member.js'
	export default {
		props: {
			member_nid: {
				type: Number
			}
		},
		data() {
			return {
				page: 1,
				list: []
			}
		},
		mounted() {
			this.getList()
		},
		methods: {
			gotoDetail(event_nid) {
				uni.navigateTo({
					url: '/pages/activity/detail?id=' + event_nid
				})
			},
			scrolltolower(){
				
			},
			getList() {
				MemberApi.index_circle({
					member_nid: this.member_nid,
					page: this.page
				}).then(res => {
					this.list = this.list.concat(res.data)
				})
			}
		}
	}
</script>

<style>
	.detail {
		display: flex;
		border-radius: 10rpx;
		margin-left: 120rpx;
		width: 550rpx;
		padding: 10rpx;
		background-color: #f4f4f5;
	}

	.left {
		width: 300rpx;
		height: 100rpx;
	}

	.right {
		margin-left: 15rpx;
		width: 220rpx;
		font-size: 24rpx;
		height: 100rpx;
	}

	.youqu-color_ {
		color: #ffd91d;
	}
</style>